//
//  ResourcesManager.m 
//
//  Created by ilongge on 2022/7/26.
//

#import "ResourcesManager.h"
@implementation ResourcesManager
+ (NSBundle *)resourcesBundle
{
    static dispatch_once_t onceToken;
    static NSBundle *resourcesBundle = nil;
    if (resourcesBundle == nil) {
        NSBundle *currrentBundle = [NSBundle bundleForClass:[ResourcesManager class]];
        NSString *buntdlePath = [currrentBundle pathForResource:@"XLCarPlateInputView" ofType:@"bundle"];
        NSBundle *bundle = [NSBundle bundleWithPath:buntdlePath];
        dispatch_once(&onceToken, ^{
            resourcesBundle = bundle;
        });
    }
    return resourcesBundle;
}

+ (UINib *)nibWith:(NSString *)nibName
{
    UINib *nib = [UINib nibWithNibName:nibName bundle:[ResourcesManager resourcesBundle]];
    
    return nib;
}
@end
